import request from '@/utils/request';

export async function getLoseStats(params) {
  return request('/api/gaolu/gaoluParamLoseStatus', {
    method: 'get',
    params: params
  });
}

export async function getCoreData(params) {
  return request('/api/gaolu/coreData', {
    method: 'post',
    data: params
  })
}

export async function getScoreQuntile(params) {
  return request('/api/gaolu/gaoLuParamDist', {
    method: 'get',
    params
  })
}

export async function getAutoScore(params) {
  return request('/api/gaolu/autoScore',{
    method: 'get',
    params: params
  });
}

export async function getScoreTrend(params) {
  return request(`/api/gaolu/scoreTrend?start=${params.start}&end=${params.end}`)
}

export async function getBanbieScore(params) {
  return request('/api/gaolu/getBanbieScore', {
    method: 'get',
    params: params
  })
}

export async function getDailyScore(params) {
  return request('/api/gaolu/getDailyScore', {
    method: 'get',
    params: params
  })
}

export async function getRules() {
  return request('/api/gaolu/ruleDefinition/get', {
    method: 'get'
  })
}


export async function getHistory(param) {

  return request(`/api/gaolu/history?start=${param.start}&end=${param.end}`)
}

export async function downloadHistory(param) {
  return request(`/api/gaolu/history/download?start=${param.start}&end=${param.end}&time=${new Date().getTime()}`,{
    responseType : 'blob'
  });
}
